﻿@model MethodDocumentation

@using ApiDoc


@{
    ViewBag.Title = Model.Name;
}

<h1>@Model.Name</h1>

<div class="description">
    <p>
    @Model.Description
    </p>
    <div class="remarks">
        @Model.Remarks
    </div>
</div>

@if (Model.ReturnType != null) {
    <div class="returnType">
        <strong>Return Type:</strong> @Html.ApiDocumentationLink(Model.ReturnType)
    </div>
}

@if (Model.ParentType != null) {
    <div class="parentType">
        <strong>Owning Type:</strong> @Html.ApiDocumentationLink(Model.ParentType)
    </div>
}

<div>
<h3>Syntax</h3>
    <div class="syntax">
        <pre class="brush: csharp">
            @Model.CodeDefinition
        </pre>
    </div>
</div>

@if (Model.GenericTypeArguments.Any()) {
    <div class="genericTypeArguments">
        <h3>Type Arguments</h3>
        <dl>
            @foreach (var argument in Model.GenericTypeArguments) {
                <dt>@argument.Name</dt>
                <dd>
                    @argument.Description
                </dd>
            }
        </dl>
    </div>
}

@if (Model.Parameters.Any()) {
    <div class="parameters">
        <h3>Parameters</h3>
        <dl>
            @foreach (var parameter in Model.Parameters) {
                <dt>@parameter.Name</dt>
                <dd>
                    @parameter.Description
                    <strong>Type:</strong> @Html.ApiDocumentationLink(parameter.ParameterType)
                </dd>
            }
        </dl>
    </div>
}


@if (!String.IsNullOrEmpty(Model.Example)) {
    <div>
        <h2>Examples</h2>
        @Model.Example
    </div>
}

@if (!String.IsNullOrEmpty(Model.SeeAlso)) {
    <div>
        <h2>See Also</h2>
        @Model.SeeAlso
    </div>
}


<!-- Syntax Highligher Scripts -->
<script type="text/javascript" src="~/Scripts/SyntaxHighlighter/shCore.js"></script>
<script type="text/javascript" src="~/Scripts/SyntaxHighlighter/shBrushCSharp.js"></script>
<link href="~/Content/SyntaxHighlighter/shCore.css" rel="stylesheet" type="text/css" />
<link href="~/Content/SyntaxHighlighter/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    SyntaxHighlighter.defaults.toolbar = false;
    SyntaxHighlighter.all();
</script>
